<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    /*
       1. get()
        -proxy[property]、
        proxy.property 
        或 Object.create(proxy)[property]
        等操作都 会触发基本的 get()操作以获取属性。
     */
    const target = {
        foo: 'bar'
    }
    const handler = {
        get() {
            return 'handler override'
        }
    }
    const proxy = new Proxy(target, handler)

    // proxy.property 
    console.log(target.foo) // bar
    console.log(proxy.foo) // handler override
    
    //proxy[property]
    console.log(target['foo'])
    console.log(proxy['foo'])
    
    // Object.create(proxy)[property]
    console.log(Object.create(target)['foo'])
    console.log(Object.create(proxy)['foo'])
    

</script>
</body>
</html>